package com.shqcjd.yunweiyanoperator.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.shqcjd.yunweiyanoperator.R;

public class LoginTipsDialog extends Dialog {
    private Button btn_dialog_commit;
    private Context context;
    private TextView tv_dialog_tips, tv_dialog_title;

    public LoginTipsDialog(@NonNull Context context) {
        super(context);
        this.context = context;
    }

    public LoginTipsDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected LoginTipsDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_login_tip);
        getWindow().setBackgroundDrawableResource(R.color.transparent);
        btn_dialog_commit = findViewById(R.id.btn_dialog_commit);
        tv_dialog_tips = findViewById(R.id.tv_dialog_tips);
        tv_dialog_title = findViewById(R.id.tv_dialog_title);
        btn_dialog_commit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });

    }


    public void setTextStr(String title, String content){
        tv_dialog_title.setText(title);
        tv_dialog_tips.setText(content);
        tv_dialog_tips.setVisibility(View.VISIBLE);
    }
}
